package com.bclz.task.flow;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import com.bclz.entity.Summarizing;

/**
 * 
* @ClassName: FlowStatisticMap  
* @Description: 统计每个手机号的总上行流量和总下行流量Map操作
* @author xuchang  
* @date 2018年9月28日
 */
public class FlowStatisticMap extends Mapper<LongWritable, Text, Text, Summarizing> {
	
	
	
	@Override
	protected void map(LongWritable offset, Text value,Context context)
			throws IOException, InterruptedException {
		// TODO Auto-generated method stub
		String[] str=value.toString().split("\t");
		context.write(new Text(str[1]), new Summarizing(Long.parseLong(str[str.length-2]), Long.parseLong(str[str.length-3])));
	}
	
	@Override
	protected void cleanup(Mapper<LongWritable, Text, Text, Summarizing>.Context context)
			throws IOException, InterruptedException {
		// TODO Auto-generated method stub
		
		System.out.println("+++++++++++++++++++++++++++++++++++++++++++");
	
	}
	
}
